package vistas2;
/**
 *
 * @author pedro
 */
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ProgresBar extends JFrame{

JProgressBar current;
JTextArea out;
JButton find;
Thread runner;
int num = 0;

public ProgresBar(int max, String title){
	super(title);
        setLocationRelativeTo(null);
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	setSize(205,68);
	setLayout(new FlowLayout());
	current = new JProgressBar(0,max);
	current.setValue(0);
	current.setStringPainted(true);
	add(current);
}


public void iterate(){
	while(num<2000){
		current.setValue(num);
		try{
			Thread.sleep(1000);
		}catch(InterruptedException e) {}
		num += 95;
	}
}

public static void main(String[] arguments){
	ProgresBar frame = new ProgresBar(2000,"kkasd");
	frame.setVisible(true);
	frame.iterate();
	frame.setVisible(false);
}
}
